package dome1;

public class Dog extends Pet {
    public Dog(String name, String type, int age, String color, int hungerDegree) {
        super(name, type, age, color, hungerDegree);
    }

    public Dog() {
    }

    @Override
    public void eat(){
        if(!isDead()) {
             setHungerDegree(getHungerDegree() - 5);
                System.out.println(this.getName() + "狗吃东西它的饥饿度减少");
            }else{
            System.out.println(this.getName()+"狗将死亡。");
        }
    }
    public void woof(){
        System.out.println("狗正在叫");
    }
}
